//
//      Copyright 2011 richard collins
//
//      This program is free software; you can redistribute it and/or modify
//      it under the terms of the GNU General Public License as published by
//      the Free Software Foundation; either version 2 of the License, or
//      (at your option) any later version.
//
//      This program is distributed in the hope that it will be useful,
//      but WITHOUT ANY WARRANTY; without even the implied warranty of
//      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//      GNU General Public License for more details.
//
//      You should have received a copy of the GNU General Public License
//      along with this program; if not, write to the Free Software
//      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
//      MA 02110-1301, USA.

// ****************************************************************************************
// As data written to this display is persistant there is no need for a timer. :)
// ****************************************************************************************
// It is wired to port A and F.
// Port A is for data and B is for the function selected. (
// We'll use the built in character set.
// ater i'll look into how to change this charater set for custom characters, if that is posible.

#include "../common/common.h"
#include "../common/display1602.h"

int main(void)
{
	Display1602_Open(1);

	char buf[17];


	u32 i = 0;
	/* loop forever */
	while (1)
	{
		i++;

		Display1602_Clear();

		sprintf(buf,"%016ld",i);

		Display1602_SetXY(0,0);
		Display1602_Print(buf);

		((u8*)buf)[0] = 0xf6;
		buf[1] = 0;
		Display1602_SetXY(i&15,1);
		Display1602_Print(buf);
		Display1602_SetXY(15 -(i&15),1);
		Display1602_Print(buf);

		delay_ms (300);
	}
}













